home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / oleo-1_4.lha / oleo-1.4 / init.c < prev    next >
C/C++ Source or Header  |  1993-05-21  |  23KB  |  606 lines

  1. /*    Copyright (C) 1993 Free Software Foundation, Inc.
  2.  
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7.  
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. GNU General Public License for more details.
  12.  
  13. You should have received a copy of the GNU General Public License
  14. along with this software; see the file COPYING.  If not, write to
  15. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  16.  
  17. #include "proto.h"
  18. #include "init.h"
  19. #include "global.h"
  20. #include "io-term.h"
  21. #include "utils.h"
  22. #include "cmd.h"
  23. /*
  24.  * These commands are run before we are ready to do output.  They
  25.  * should not do any kind of io or cause errors.  If they do, you
  26.  * will experience core dumps.
  27.  */
  28. char *init_cmds[] =
  29. {
  30.   "",
  31.   "# The keymap tree.",
  32.   "",
  33.   "# The map `universal' already exists, and is always the keymap of last",
  34.   "# resort.  It is almost always a bad idea to add new bindings there.",
  35.   "",
  36.   "# This is the generic top-level keymap.   It should contain bindings that",
  37.   "# apply at the top level keymap regardless of what mode the editor is in.",
  38.   "# All keymaps that are used at the top level should inerit from this.",
  39.   "create-keymap generic-main universal",
  40.   "",
  41.   "# This is the keymap in force at the top level when no command arguments are",
  42.   "# being edited.",
  43.   "create-keymap main generic-main",
  44.   "",
  45.   "# The keymap after a M- or ESC prefix in main:",
  46.   "create-keymap generic-meta universal",
  47.   "create-keymap meta generic-meta",
  48.   "",
  49.   "# The keymap for ESC [, Arrow keys are bound in this map.",
  50.   "create-keymap generic-ansi universal",
  51.   "create-keymap ansi generic-ansi",
  52.   "",
  53.   "create-keymap generic-trolx universal",
  54.   "create-keymap trolx generic-trolx",
  55.   "",
  56.   "# Bindings that define prefix keys.",
  57.   "bind-key generic-main generic-meta ^[",
  58.   "bind-key main meta ^[",
  59.   "",
  60.   "create-keymap mouse universal",
  61.   "bind-key generic-main mouse ^\\\\",
  62.   "bind-key mouse mouse-goto 0",
  63.   "bind-key mouse mouse-mark 1",
  64.   "bind-key mouse mouse-mark-and-goto 2",
  65.   "",
  66.   "",
  67.   "bind-key generic-main generic-trolx ^x",
  68.   "bind-key main trolx ^x",
  69.   "",
  70.   "bind-key generic-meta generic-ansi [",
  71.   "bind-key meta ansi [",
  72.   "",
  73.   "# Misc generic commands",
  74.   "",
  75.   "bind-key universal break ^g",
  76.   "bind-key universal redraw-screen ^l",
  77.   "bind-key generic-main universal-argument ^u",
  78.   "bind-key generic-main suspend-oleo ^z",
  79.   "bind-key generic-trolx kill-oleo ^c",
  80.   "bind-key generic-trolx recalculate !",
  81.   "bind-key generic-meta execute-command x",
  82.   "",
  83.   "# Prefix argument handling",
  84.   "# This keymap is magicly invoked within command_loop in cmd.c.",
  85.   "create-keymap prefix universal",
  86.   "bind-set prefix universal-argument 0-9",
  87.   "bind-key prefix universal-argument -",
  88.   "",
  89.   "#",
  90.   "# Cursor motion",
  91.   "#",
  92.   "",
  93.   "# For EMACS users",
  94.   "# Notice that these motion commands are not bound genericly.  They don't",
  95.   "# in general apply if the input area is active.",
  96.   "",
  97.   "bind-key main    up-cell  ^p",
  98.   "bind-key main right-cell  ^f",
  99.   "bind-key main  left-cell  ^b",
  100.   "bind-key main  down-cell  ^n",
  101.   "",
  102.   "# Ansi motion.",
  103.   "bind-key generic-ansi up-cell A",
  104.   "bind-key generic-ansi down-cell B",
  105.   "bind-key generic-ansi right-cell C",
  106.   "bind-key generic-ansi left-cell D",
  107.   "",
  108.   "# These are only useful under X, but there, they are quite useful.",
  109.   "name-macro-string up-cell-and-edit \\",
  110.   "{exit-minibuffer}{up-cell}{edit-cell}",
  111.   "name-macro-string down-cell-and-edit \\",
  112.   "{exit-minibuffer}{down-cell}{edit-cell}",
  113.   "name-macro-string left-cell-and-edit \\",
  114.   "{exit-minibuffer}{left-cell}{edit-cell}",
  115.   "name-macro-string right-cell-and-edit \\",
  116.   "{exit-minibuffer}{right-cell}{edit-cell}",
  117.   "",
  118.   "create-keymap edit-ansi generic-ansi",
  119.   "bind-key edit-ansi up-cell-and-edit A",
  120.   "bind-key edit-ansi down-cell-and-edit B",
  121.   "bind-key edit-ansi forward-char C",
  122.   "bind-key edit-ansi backward-char D",
  123.   "",
  124.   "create-keymap meta-edit-ansi universal",
  125.   "bind-key edit-ansi meta-edit-ansi ^[",
  126.   "bind-key meta-edit-ansi up-cell-and-edit A",
  127.   "bind-key meta-edit-ansi down-cell-and-edit B",
  128.   "bind-key meta-edit-ansi right-cell-and-edit C",
  129.   "bind-key meta-edit-ansi left-cell-and-edit D",
  130.   "",
  131.   "bind-key trolx goto-cell j",
  132.   "bind-key meta goto-region j",
  133.   "",
  134.   "# Going to extremes",
  135.   "bind-key meta upper-left <",
  136.   "bind-key meta lower-right >",
  137.   "",
  138.   "# Marking time",
  139.   "bind-key trolx exchange-point-and-mark ^X",
  140.   "bind-key main mark-cell ^@",
  141.   "",
  142.   "# Scrolling commands.",
  143.   "bind-key meta scroll-up v",
  144.   "bind-key main scroll-down ^V",
  145.   "bind-key trolx scroll-right >",
  146.   "bind-key trolx scroll-left <",
  147.   "",
  148.   "# Other ways of moving the cell cursor.",
  149.   "",
  150.   "bind-key meta scan-up p",
  151.   "bind-key meta scan-down n",
  152.   "bind-key meta scan-left b",
  153.   "bind-key meta scan-right f",
  154.   "",
  155.   "bind-key main beginning-of-row ^a",
  156.   "bind-key main end-of-row ^e",
  157.   "bind-key meta beginning-of-col ^a",
  158.   "bind-key meta end-of-col ^e",
  159.   "",
  160.   "# Macros",
  161.   "bind-key generic-trolx start-entering-macro (",
  162.   "bind-key generic-trolx stop-entering-macro )",
  163.   "bind-key generic-trolx call-last-kbd-macro e",
  164.   "bind-key generic-trolx store-last-macro =",
  165.   "",
  166.   "# The keymap used when prompting for a key-sequence: ",
  167.   "create-keymap read-keyseq universal",
  168.   "bind-set read-keyseq self-map-command \\000-\\377",
  169.   "",
  170.   "# Help commands",
  171.   "create-keymap generic-help universal",
  172.   "create-keymap unprompted-help generic-help",
  173.   "create-keymap help generic-help",
  174.   "bind-key generic-main unprompted-help ^h",
  175.   "bind-key main help ^h",
  176.   "bind-key unprompted-help help ^h",
  177.   "bind-key unprompted-help help ?",
  178.   "",
  179.   "set-map-prompt help \\",
  180.   "Help keys (type ? for more explanation): C c f F k o v w W ^W",
  181.   "",
  182.   "bind-key generic-help help-with-command C",
  183.   "bind-key generic-help describe-key-briefly c",
  184.   "bind-key generic-help describe-function f",
  185.   "bind-key generic-help describe-formula F",
  186.   "bind-key generic-help describe-key k",
  187.   "bind-key generic-help show-options o",
  188.   "bind-key generic-help show-variable v",
  189.   "bind-key generic-help show-all-variables ^v",
  190.   "bind-key generic-help where-is w",
  191.   "",
  192.   "name-macro-string view-wallchart \\",
  193.   "{make-wallchart-info}{with-keymap view-info}{set-info wallchart}",
  194.   "bind-key generic-help view-wallchart W",
  195.   "",
  196.   "name-macro-string write-wallchart \\",
  197.   "{make-wallchart-info}{write-info wallchart}",
  198.   "bind-key generic-help write-wallchart ^w",
  199.   "",
  200.   "create-keymap verbose-help-map generic-help",
  201.   "set-map-prompt verbose-help-map \\",
  202.   "Help (+,-,ESC or one of the help characters): ",
  203.   "",
  204.   "",
  205.   "name-macro-string verbose-help \\",
  206.   "  {with-keymap verbose-help-map}{builtin-help help-with-help}",
  207.   "",
  208.   "bind-key help verbose-help ^h",
  209.   "bind-key help verbose-help ?",
  210.   "",
  211.   "bind-key verbose-help-map exit-minibuffer ^[",
  212.   "bind-key verbose-help-map page-info +",
  213.   "bind-key verbose-help-map page-info-backwards -",
  214.   "",
  215.   "name-macro-string verbose-hwc {exit-minibuffer}{help-with-command}",
  216.   "name-macro-string verbose-dkb {exit-minibuffer}{describe-key-briefly}",
  217.   "name-macro-string verbose-df {exit-minibuffer}{describe-function}",
  218.   "name-macro-string verbose-dk {exit-minibuffer}{describe-key}",
  219.   "name-macro-string verbose-so {exit-minibuffer}{show-options}",
  220.   "name-macro-string verbose-sv {exit-minibuffer}{show-variable}",
  221.   "name-macro-string verbose-sav {exit-minibuffer}{show-all-variables}",
  222.   "name-macro-string verbose-w {exit-minibuffer}{where-is}",
  223.   "",
  224.   "bind-key verbose-help-map verbose-hwc C",
  225.   "bind-key verbose-help-map verbose-dkb c",
  226.   "bind-key verbose-help-map verbose-df  f",
  227.   "bind-key verbose-help-map verbose-dk  k",
  228.   "bind-key verbose-help-map verbose-so  o",
  229.   "bind-key verbose-help-map verbose-sv  v",
  230.   "bind-key verbose-help-map verbose-sav ^v",
  231.   "bind-key verbose-help-map verbose-w   w",
  232.   "",
  233.   "",
  234.   "# Variables",
  235.   "bind-key trolx set-variable :",
  236.   "",
  237.   "# Files",
  238.   "",
  239.   "bind-key generic-trolx save-spreadsheet ^s",
  240.   "bind-key trolx find-alternate-spreadsheet ^v",
  241.   "bind-key trolx merge-spreadsheet i",
  242.   "",
  243.   "bind-key meta copy-region c",
  244.   "bind-key meta copy-values-in-region ^c",
  245.   "bind-key meta move-region m",
  246.   "bind-key main insert-row ^o",
  247.   "bind-key meta insert-col o",
  248.   "bind-key main delete-row ^k",
  249.   "bind-key meta delete-col k",
  250.   "",
  251.   "# Changing cell formulas",
  252.   "bind-key main edit-cell =",
  253.   "",
  254.   "# Some characters start editing the current cell and then are reinterpreted",
  255.   "# as editing commands:",
  256.   "bind-set main goto-edit-cell a-z",
  257.   "bind-set main goto-edit-cell A-Z",
  258.   "bind-set main goto-edit-cell 0-9",
  259.   "bind-key main goto-edit-cell \\",
  260.   "bind-key main goto-edit-cell +",
  261.   "bind-key main goto-edit-cell -",
  262.   "bind-key main goto-edit-cell *",
  263.   "bind-key main goto-edit-cell /",
  264.   "bind-key main goto-edit-cell (",
  265.   "bind-key main goto-edit-cell )",
  266.   "bind-key main goto-edit-cell @",
  267.   "bind-key main goto-edit-cell ^",
  268.   "bind-key main goto-edit-cell %",
  269.   "bind-key main goto-edit-cell >",
  270.   "bind-key main goto-edit-cell <",
  271.   "bind-key main goto-edit-cell !",
  272.   "bind-key main goto-edit-cell ?",
  273.   "bind-key main goto-edit-cell :",
  274.   "bind-key main goto-edit-cell #",
  275.   "bind-key main goto-edit-cell _",
  276.   "bind-key main goto-edit-cell .",
  277.   "bind-key main goto-edit-cell ,",
  278.   "bind-key main goto-edit-cell ;",
  279.   "bind-key main goto-edit-cell  \"",
  280.   "bind-key meta set-region-formula =",
  281.   "bind-key main delete-cell ^?",
  282.   "bind-key meta delete-region ^?",
  283.   "",
  284.   "",
  285.   "# Window commands",
  286.   "",
  287.   "bind-key meta recenter-window ^l",
  288.   "bind-key trolx split-window-horizontally 5",
  289.   "bind-key trolx split-window-vertically 2",
  290.   "bind-key trolx delete-window 0",
  291.   "bind-key trolx delete-other-windows 1",
  292.   "bind-key meta goto-minibuffer ^",
  293.   "bind-key trolx other-window o",
  294.   "",
  295.   "# Command argument editing",
  296.   "",
  297.   "create-keymap read-string generic-main",
  298.   "create-keymap meta-read-string generic-meta",
  299.   "create-keymap trolx-read-string generic-trolx",
  300.   "",
  301.   "bind-key read-string meta-read-string ^[",
  302.   "bind-set read-string self-insert-command \\ -~",
  303.   "bind-key read-string exit-minibuffer ^m",
  304.   "bind-key read-string beginning-of-line ^a",
  305.   "bind-key read-string end-of-line ^e",
  306.   "bind-key read-string backward-char ^b",
  307.   "bind-key meta-read-string backward-word b",
  308.   "bind-key read-string backward-delete-char ^?",
  309.   "bind-key meta-read-string backward-delete-word ^?",
  310.   "bind-key read-string forward-char ^f",
  311.   "bind-key meta-read-string forward-word f",
  312.   "bind-key read-string delete-char ^d",
  313.   "bind-key meta-read-string delete-word d",
  314.   "bind-key read-string kill-line ^k",
  315.   "bind-key meta-read-string insert-cell-expression e",
  316.   "bind-key meta-read-string insert-cell-value v",
  317.   "bind-key meta-read-string insert-rel-ref r",
  318.   "bind-key meta-read-string insert-abs-ref a",
  319.   "",
  320.   "bind-key read-string trolx-read-string ^x",
  321.   "bind-key trolx-read-string other-window o",
  322.   "",
  323.   "# Reading various argument types specificly",
  324.   "create-keymap read-symbol read-string",
  325.   "create-keymap read-word read-string",
  326.   "create-keymap read-range read-string",
  327.   "create-keymap read-filename read-string",
  328.   "create-keymap read-integer read-string",
  329.   "create-keymap read-float read-string",
  330.   "create-keymap read-formula read-string",
  331.   "",
  332.   "# Special arrow key meanings for edit mode",
  333.   "create-keymap meta-read-formula meta-read-string",
  334.   "bind-key read-formula meta-read-formula ^[",
  335.   "bind-key meta-read-formula edit-ansi [",
  336.   "",
  337.   "# auto-motion",
  338.   "create-keymap set-auto-motion universal",
  339.   "set-map-prompt set-auto-motion \\",
  340.   "Set auto-motion direction [^v<>`'/\\ or SPC for none] ",
  341.   "",
  342.   "bind-key generic-trolx set-auto-motion m",
  343.   "",
  344.   "bind-key set-auto-motion auto-move-up ^",
  345.   "bind-key set-auto-motion auto-move-down v",
  346.   "bind-key set-auto-motion auto-move-down V",
  347.   "bind-key set-auto-motion auto-move-left <",
  348.   "bind-key set-auto-motion auto-move-left ,",
  349.   "bind-key set-auto-motion auto-move-right >",
  350.   "bind-key set-auto-motion auto-move-right .",
  351.   "bind-key set-auto-motion auto-move-up-right '",
  352.   "bind-key set-auto-motion auto-move-up-left `",
  353.   "bind-key set-auto-motion auto-move-down-right \\\\   ",
  354.   "bind-key set-auto-motion auto-move-down-left  /",
  355.   "bind-key set-auto-motion auto-move-no-motion \\ ",
  356.   "",
  357.   "bind-key read-formula next-edit ^i",
  358.   "bind-key read-formula next-edit-set ^j",
  359.   "",
  360.   "create-keymap read-most-chars universal",
  361.   "",
  362.   "bind-set read-most-chars exit-self-inserting \\000-\\377",
  363.   "bind-key read-most-chars break ^G",
  364.   "bind-key read-most-chars redraw-screen ^L",
  365.   "",
  366.   "create-keymap press-any universal",
  367.   "set-map-prompt press-any \\",
  368.   "Press any key to continue. ",
  369.   "bind-set press-any exit-minibuffer \\000-\\377",
  370.   "bind-key press-any break ^G",
  371.   "bind-key press-any redraw-screen ^L",
  372.   "",
  373.   "create-keymap read-char read-most-chars",
  374.   "bind-key read-char exit-self-inserting ^G",
  375.   "",
  376.   "",
  377.   "# Menu driven commands use this keymap to read menu selections",
  378.   "create-keymap read-menu read-most-chars",
  379.   "bind-key read-menu help-with-command ^h",
  380.   "",
  381.   "create-keymap read-format read-string",
  382.   "",
  383.   "# These maps are used to manipulate cell attributes.",
  384.   "# They reimplement the old format-cell, format-region and",
  385.   "# set-default commands.",
  386.   "",
  387.   "create-keymap set-cell-attr     universal",
  388.   "create-keymap set-region-attr     universal",
  389.   "create-keymap set-default-attr     universal",
  390.   "",
  391.   "set-map-prompt set-cell-attr \\",
  392.   "Set cell [A]lignment [F]ormat f[O]nt [P]rotection [H]eight [W]idth",
  393.   "set-map-prompt set-region-attr \\",
  394.   "Set region [A]lignment [F]ormat f[O]nt [P]rotection [H]eight [W]idth",
  395.   "set-map-prompt set-default-attr \\",
  396.   "Set default [A]lignment [F]ormat f[O]nt [P]rotection [H]eight [W]idth",
  397.   "",
  398.   "bind-key meta set-default-attr d",
  399.   "bind-key meta set-region-attr r",
  400.   "bind-key meta set-cell-attr a",
  401.   "",
  402.   "bind-key set-cell-attr    set-cell-alignment    a",
  403.   "bind-key set-cell-attr    set-cell-format        f",
  404.   "bind-key set-cell-attr    set-cell-font        o",
  405.   "bind-key set-cell-attr    set-cell-protection    p",
  406.   "bind-key set-cell-attr    set-cell-height        h",
  407.   "bind-key set-cell-attr    set-cell-width        w",
  408.   "bind-key set-cell-attr    set-cell-alignment    A",
  409.   "bind-key set-cell-attr    set-cell-format        F",
  410.   "bind-key set-cell-attr    set-cell-font        O",
  411.   "bind-key set-cell-attr    set-cell-protection    P",
  412.   "bind-key set-cell-attr    set-cell-height        H",
  413.   "bind-key set-cell-attr    set-cell-width        W",
  414.   "",
  415.   "bind-key set-region-attr    set-region-alignment        a",
  416.   "bind-key set-region-attr    set-region-format        f",
  417.   "bind-key set-region-attr    set-region-font            o",
  418.   "bind-key set-region-attr    set-region-protection        p",
  419.   "bind-key set-region-attr    set-region-height        h",
  420.   "bind-key set-region-attr    set-region-width        w",
  421.   "bind-key set-region-attr    set-region-alignment        A",
  422.   "bind-key set-region-attr    set-region-format        F",
  423.   "bind-key set-region-attr    set-region-font            O",
  424.   "bind-key set-region-attr    set-region-protection        P",
  425.   "bind-key set-region-attr    set-region-height        H",
  426.   "bind-key set-region-attr    set-region-width        W",
  427.   "",
  428.   "bind-key set-default-attr    set-default-alignment        a",
  429.   "bind-key set-default-attr    set-default-format        f",
  430.   "bind-key set-default-attr    set-default-font        o",
  431.   "bind-key set-default-attr    set-default-protection        p",
  432.   "bind-key set-default-attr    set-default-height        h",
  433.   "bind-key set-default-attr    set-default-width        w",
  434.   "bind-key set-default-attr    set-default-alignment        A",
  435.   "bind-key set-default-attr    set-default-format        F",
  436.   "bind-key set-default-attr    set-default-font        O",
  437.   "bind-key set-default-attr    set-default-protection        P",
  438.   "bind-key set-default-attr    set-default-height        H",
  439.   "bind-key set-default-attr    set-default-width        W",
  440.   "",
  441.   "create-keymap view-info universal",
  442.   "bind-key view-info exit-minibuffer ^[",
  443.   "bind-key view-info page-info \\ ",
  444.   "bind-key view-info page-info +",
  445.   "bind-key view-info page-info-backwards -",
  446.   "",
  447.   "set-map-prompt view-info \\",
  448.   "+ (forward page)   - (backward page)   ESC (return to spreadsheet editing)",
  449.   "",
  450.   "",
  451.   "",
  452.   " ",
  453.   "",
  454.   "# Verbose menu type keymaps use exit-minibuffer to move closer",
  455.   "# to the root of the menu.",
  456.   "",
  457.   "create-keymap generic-menu universal",
  458.   "bind-key generic-menu exit-minibuffer ^[",
  459.   "bind-key generic-menu exit-minibuffer ^m",
  460.   "bind-key generic-menu exit-minibuffer ^j",
  461.   "",
  462.   "# Graphing with gnuplot",
  463.   "",
  464.   "create-keymap graph-commands generic-menu",
  465.   "name-macro-string graph-setup \\",
  466.   " {with-keymap graph-commands}{builtin-help graphing}",
  467.   "bind-key generic-meta graph-setup g",
  468.   "set-map-prompt graph-commands \\",
  469.   "(R C o x y t d s p Esc)? ",
  470.   "",
  471.   "name-macro-string graph-preset-msg {display-error-msg Graph reset}",
  472.   "name-macro-string graph-presets-verbosely \\",
  473.   "{graph-presets}{graph-preset-msg}{set-info _expanded__info_graphing}",
  474.   "bind-key graph-commands graph-presets-verbosely R",
  475.   "",
  476.   "name-macro-string graph-clear-msg {display-error-msg Graph data reset}",
  477.   "name-macro-string graph-clear-verbosely \\",
  478.   "{graph-clear-datasets}{graph-clear-msg}{set-info _expanded__info_graphing}",
  479.   "bind-key graph-commands graph-clear-verbosely C",
  480.   "",
  481.   "bind-key graph-commands graph-set-data-title t",
  482.   "bind-key graph-commands graph-set-data d",
  483.   "bind-key graph-commands graph-set-style s",
  484.   "bind-key graph-commands graph-plot p",
  485.   "",
  486.   "create-keymap view-graphing-parameters view-info",
  487.   "name-macro-string graph-verify \\",
  488.   "{graph-make-info}{with-keymap view-graphing-parameters}{set-info graphing-parameters}",
  489.   "bind-key graph-commands graph-verify v",
  490.   "set-map-prompt view-graphing-parameters \\",
  491.   "+ (forward page)   - (backward page)   p (plot)  or  ESC",
  492.   "bind-key view-graphing-parameters graph-plot p",
  493.   "",
  494.   "create-keymap graph-terminal-types universal",
  495.   "name-macro-string graph-select-output \\",
  496.   "{one-command-with-keymap graph-terminal-types}{builtin-help graph-output-types}",
  497.   "bind-key graph-commands graph-select-output o",
  498.   "set-map-prompt graph-terminal-types \\",
  499.   "Graph output type (x X P): ",
  500.   "bind-key graph-terminal-types graph-x11-mono x",
  501.   "bind-key graph-terminal-types graph-x11-color X",
  502.   "bind-key graph-terminal-types graph-postscript p",
  503.   "",
  504.   "create-keymap graph-x-axis-commands generic-menu",
  505.   "name-macro-string graph-x-axis \\",
  506.   "{with-keymap graph-x-axis-commands}{builtin-help graph-x-axis-help}",
  507.   "bind-key graph-commands graph-x-axis x",
  508.   "set-map-prompt graph-x-axis-commands X-axis (s [ ] l L Esc)",
  509.   "",
  510.   "name-macro-string graph-set-x-range-low {graph-set-axis-low x}",
  511.   "name-macro-string graph-set-x-range-high {graph-set-axis-high x}",
  512.   "bind-key graph-x-axis-commands graph-set-x-range-low [",
  513.   "bind-key graph-x-axis-commands graph-set-x-range-high ]",
  514.   "bind-key graph-x-axis-commands graph-set-x-axis-symbolic s",
  515.   "name-macro-string graph-set-x-labels {graph-set-axis-labels x}",
  516.   "bind-key graph-x-axis-commands graph-set-x-labels l",
  517.   "name-macro-string graph-default-x-labels {graph-default-axis-labels x}",
  518.   "bind-key graph-x-axis-commands graph-default-x-labels L",
  519.   "",
  520.   "create-keymap graph-y-axis-commands generic-menu",
  521.   "name-macro-string graph-y-axis \\",
  522.   "{with-keymap graph-y-axis-commands}{builtin-help graph-y-axis-help}",
  523.   "bind-key graph-commands graph-y-axis y",
  524.   "set-map-prompt graph-y-axis-commands Y-axis (s [ ] l L Esc)",
  525.   "",
  526.   "name-macro-string graph-set-y-range-low {graph-set-axis-low y}",
  527.   "name-macro-string graph-set-y-range-high {graph-set-axis-high y}",
  528.   "bind-key graph-y-axis-commands graph-set-y-range-low [",
  529.   "bind-key graph-y-axis-commands graph-set-y-range-high ]",
  530.   "name-macro-string graph-set-y-labels {graph-set-axis-labels y}",
  531.   "bind-key graph-y-axis-commands graph-set-y-labels l",
  532.   "name-macro-string graph-default-y-labels {graph-default-axis-labels y}",
  533.   "bind-key graph-y-axis-commands graph-default-y-labels L",
  534.   "",
  535.   "# printing",
  536.   "",
  537.   "create-keymap print-commands universal",
  538.   "bind-key meta print-commands ^p",
  539.   "set-map-prompt print-commands \\",
  540.   "[A]scii or [P]ostscript printing? ",
  541.   "",
  542.   "bind-key print-commands print-region a",
  543.   "bind-key print-commands print-region A",
  544.   "",
  545.   "create-keymap psprint-commands universal",
  546.   "bind-key print-commands psprint-commands p",
  547.   "bind-key print-commands psprint-commands P",
  548.   "set-map-prompt psprint-commands \\",
  549.   "set default [F]ont   set page [S]ize   [P]rint",
  550.   "",
  551.   "bind-key psprint-commands set-page-size s",
  552.   "bind-key psprint-commands set-page-size S",
  553.   "bind-key psprint-commands set-default-ps-font f",
  554.   "bind-key psprint-commands set-default-ps-font F",
  555.   "bind-key psprint-commands psprint-region p",
  556.   "bind-key psprint-commands psprint-region P",
  557.   "",
  558.   "",
  559.   "# Other init commands:",
  560.   "define-font times *times-medium-r-* Times-Roman",
  561.   "define-font times-italic *times-medium-i-* Times-Italic",
  562.   "define-font times-oblique *times-medium-o-* Times-Italic",
  563.   "define-font times-bold *times-bold-r-* Times-Bold",
  564.   "define-font times-oblique-bold *times-bold-o-* Times-BoldItalic",
  565.   "define-font times-italic-bold *times-bold-i-* Times-BoldItalic",
  566.   "define-font courier *courier-medium-r-* Courier",
  567.   "define-font courier-oblique *courier-medium-o-* Courier-Italic",
  568.   "define-font courier-bold *courier-bold-r-* Courier-Bold",
  569.   "define-font courier-bold-oblique *courier-bold-o-* Courier-BoldItalic",
  570.   "define-font helvetica *helvetica-medium-r-* Helvetica",
  571.   "define-font helvetica-oblique *helvetica-medium-o-* Helvetica-Italic",
  572.   "define-font helvetica-bold *helvetica-bold-r-* Helvetica-Bold",
  573.   "define-font helvetica-bold-oblique *helvetica-bold-o-* Helvetica-BoldItalic",
  574.   "define-font fixed *fixed-medium-r-* Times-Roman",
  575.  
  576.   0
  577.  
  578. };
  579.  
  580. #ifdef __STDC__
  581. void 
  582. run_init_cmds (void)
  583. #else
  584. void 
  585. run_init_cmds ()
  586. #endif
  587. {
  588.   char **p = init_cmds;
  589.   while (*p)
  590.     {
  591.       char * cmd = strdup (*p++);
  592.       int len = strlen (cmd);
  593.       while (len && *p && (cmd [len - 1] == '\\')
  594.          && ((len == 1) || cmd[len - 2] != '\\'))
  595.     {
  596.       cmd [len - 1] = '\0';
  597.       len += strlen (*p);
  598.       cmd = ck_realloc (cmd, len + 1);
  599.       strcat (cmd, *p);
  600.       ++p;
  601.     }
  602.       execute_command (cmd);
  603.       free (cmd);
  604.     }
  605. }
  606.